package com.lxk.service.pay.enums;

/**
 * 模式
 */
public enum PayModelEnum {
    NORMAL_MODE("1", "普通支付模式"),
    CERT_MODEL("2", "证书验证支付模式"),
    ;

    private final String code;
    private final String desc;

    PayModelEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static PayModelEnum getByCode(String code) {
        for (PayModelEnum payModel : values()) {
            if (payModel.getCode().equals(code)) {
                return payModel;
            }
        }
        throw new IllegalArgumentException("Invalid code: " + code);
    }
}
